//package com.ruoyi.service.impl;
//
//import com.ruoyi.entity.ElasticSearch;
//import com.ruoyi.mapper.ElasticSearchRepository;
//import com.ruoyi.service.ElasticSearchService;
//import org.springframework.data.elasticsearch.core.SearchHit;
//import org.springframework.stereotype.Service;
//
//import javax.annotation.Resource;
//import java.util.List;
//
//@Service
//public class ElasticSearchServiceImpl implements ElasticSearchService {
//
//    @Resource
//    private ElasticSearchRepository elasticSearchRepository;
//
//    @Override
//    public void save(ElasticSearch article) {
//        elasticSearchRepository.save(article);
//    }
//
//    @Override
//    public ElasticSearch findById(Integer id) {
//        return elasticSearchRepository.findById(id).orElse(new ElasticSearch());
//    }
//
//    @Override
//    public void deleteById(Integer id) {
//        elasticSearchRepository.deleteById(id);
//    }
//
//    @Override
//    public long count() {
//        return elasticSearchRepository.count();
//    }
//
//    @Override
//    public boolean existsById(Integer id) {
//        return elasticSearchRepository.existsById(id);
//    }
//
//    @Override
//    public List<SearchHit<ElasticSearch>> findByTitleOrContent(String title, String content) {
//        return elasticSearchRepository.findByTitleOrContent(title,content);
//    }
//}
